package design_mode.策略模式;

import design_mode.策略模式.打折算法.CashNormal;
import design_mode.策略模式.打折算法.CashRebate;
import design_mode.策略模式.打折算法.CashReturn;
import design_mode.策略模式.打折算法.CashSuper;

public class CashFactory {
    public static CashSuper cashSuper(int cashType) {
        CashSuper result = null;
        switch (cashType) {
            case 1:
                result = new CashNormal();
                break;
            case 2:
                result = new CashRebate(0.8);
                break;
            case 3:
                result = new CashReturn(200, 2);
                break;
        }
        return result;
    }

}
